Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve push click behavior #247

Merged
merged 16 commits into from
Nov 14, 2023
Merged

feat: improve push click behavior #247

merged 16 commits into from
Nov 14, 2023

Conversation

mrehan27
Copy link
Contributor

@mrehan27 mrehan27 commented Sep 4, 2023

helps: https://github.com/customerio/issues/issues/10830

Changes

  • Add TrackableScreen interface to provide screen name for auto screen tracking
  • Implement TrackableScreen in Java sample

Pending Items

  • Update default values after squad discussion

Note

This is base PR for improving push click behavior. Changes planned in this PR directly are final, but will be kept in draft till the feature is complete. Further changes for the feature will be merged through more PRs into this branch and then released after final testing.

@mrehan27 mrehan27 requested a review from a team September 4, 2023 10:03
@mrehan27 mrehan27 self-assigned this Sep 4, 2023
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: rehan/push-click-behavior (1699951544)
  • kotlin_compose: rehan/push-click-behavior (1699951564)

@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Attention: 105 lines in your changes are missing coverage. Please review.

Comparison is base (c494bb0) 49.76% compared to head (2032b89) 53.59%.
Report is 23 commits behind head on main.

Files Patch % Lines
...inginapp/gist/presentation/engine/EngineWebView.kt 0.00% 28 Missing ⚠️
...ava/io/customer/messagingpush/util/DeepLinkUtil.kt 5.00% 19 Missing ⚠️
...stomer/messaginginapp/gist/data/listeners/Queue.kt 21.42% 11 Missing ⚠️
...saginginapp/gist/presentation/GistModalActivity.kt 0.00% 11 Missing ⚠️
sdk/src/main/java/io/customer/sdk/CustomerIO.kt 0.00% 11 Missing ⚠️
...push/activity/NotificationClickReceiverActivity.kt 63.15% 5 Missing and 2 partials ⚠️
...essagingpush/processor/PushMessageProcessorImpl.kt 87.03% 5 Missing and 2 partials ⚠️
...ssaginginapp/gist/presentation/GistModalManager.kt 0.00% 5 Missing ⚠️
...stomer/messaginginapp/gist/presentation/GistSdk.kt 33.33% 2 Missing ⚠️
...messagingpush/CustomerIOPushNotificationHandler.kt 80.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #247      +/-   ##
============================================
+ Coverage     49.76%   53.59%   +3.82%     
- Complexity      237      278      +41     
============================================
  Files           108      109       +1     
  Lines          2781     2812      +31     
  Branches        364      352      -12     
============================================
+ Hits           1384     1507     +123     
+ Misses         1282     1183      -99     
- Partials        115      122       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Build available to test
Version: rehan-push-click-behavior-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Copy link
Contributor

@Shahroz16 Shahroz16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one alternative solution added.

Copy link
Contributor

@levibostian levibostian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite understanding the reason for this pull request. I see "Update auto tracking to skip screen event for specific activity" as the task that was completed by this pull request in the ticket.

That makes me think the reason for skipping screen events for specific activity is because you will be introducing a new Activity to the CIO SDK and you want to make sure that the new Activity does not get tracked by CIO auto screenview tracking.

If that is all true, is there a simplified solution? Adding a new interface TrackableScreen feels like a new feature added to the CIO SDK for customers to use. I was not expecting a new feature, but a different solution such as a hard-coded filter in the SDK's screenview tracking logic that skipped Activities in the CIO SDK that should not be tracked.

Have you considered other solutions? Is there a solution that is more simple then this one?

@mrehan27
Copy link
Contributor Author

mrehan27 commented Sep 6, 2023

@levibostian Yes the change prevents new activity from being tracked by CIO auto-screen tracking. The PR does exactly what is described in the task breakdown. Current approach is much better than solutions like hard-coding filters. And even if it adds a feature, it does without breaking existing functionality and requires minimal effort on our part. I don’t see any reason for not continuing with it. If you have any suggestions for improvement or see any issues with this approach, feel free to mention them. Otherwise, let’s continue the discussion in the parent ticket or on Slack.

@levibostian
Copy link
Contributor

levibostian commented Sep 7, 2023

I am open to a solution such as this one where an interface is used to determine if a screen should be tracked or not.

My hesitations come up from:

  • The use of this new interface TrackableScreen in the sample apps. If we are to begin using TrackableScreen in the sample apps, that makes me think we are suggesting it as our recommended approach to doing automatic screenview tracking in the SDK. Especially with the use of getScreenName() where we are returning different values for certain fragments, TrackableScreen seems as though it's trying to fix an unrelated problem to push click behavior. I suggest we introduce a new feature such as this with a new ticket and new PR.
  • The naming of TrackableScreen makes it seem as though you need to use it in order for a screen to be tracked. A customer might ask, "If you do not inherit TrackableScreen, will my screen still be tracked?". We can discuss naming if this feature is turned into a new ticket with new PR.

I have an idea to suggest. Would it work for a refactor to the PR where TrackableScreen is renamed to DoNotTrackScreen and the interface is internal or undocumented? If it's an interface that is currently only used internally (not used in sample apps), I would be OK with this. Then, we can expose this interface to the public and make it a documented feature in the future if we believe it's important to add.

Update: I find the rename to DoNotTrackScreen to be optional. As long as the interface is internal and removed from sample app use, I would be OK with the solution. I do agree, I find an interface to be better then a hard-coded list of Activities.

@mrehan27
Copy link
Contributor Author

mrehan27 commented Sep 8, 2023

@levibostian I actually started implementing this with DoNotTrackScreen but ended up on TrackableScreen. Because I think the number of changes are almost same but TrackableScreen is more flexible. I'm okay with removing it from sample apps though if we have more votes on it.

For the interface, I don't think this can be confusing for customers because we are not yet going to add this in docs. If the customers find out the interface themselves, the doc on it already explains it is fully optional. We can discuss any improvements in docs or name on the file, if you have any ideas in my mind, please post it on TrackableScreen so it is easier to discuss in thread.

@levibostian
Copy link
Contributor

In general, I believe that code should not be added to a sample app unless it's a public facing feature that is fully documented.

Therefore, I would approve of the PR if TrackableScreen was internal (either in scope or a comment on it specifying that it's currently only used internally) and all references to it were removed from the sample apps.

As you have mentioned, I agree that if we do decide to make this a public feature add in the the future, naming and improvements could be discussed at that time. For internal use, this looks good to me.

@mrehan27 mrehan27 marked this pull request as ready for review November 14, 2023 08:45
@mrehan27 mrehan27 merged commit bcc5318 into main Nov 14, 2023
30 checks passed
@mrehan27 mrehan27 deleted the rehan/push-click-behavior branch November 14, 2023 09:52
github-actions bot pushed a commit that referenced this pull request Nov 14, 2023
## [3.8.0](3.7.1...3.8.0) (2023-11-14)

### Features

* improve push click behavior ([#247](#247)) ([bcc5318](bcc5318))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants